#ifndef __IIC_MASTER_H_
#define __IIC_MASTER_H_
#include "esp_err.h"
#include "driver/i2c.h"

#define I2C_EXAMPLE_MASTER_SCL_IO           14                /*!< gpio number for I2C master clock */
#define I2C_EXAMPLE_MASTER_SDA_IO           2               /*!< gpio number for I2C master data  */
#define I2C_EXAMPLE_MASTER_NUM              I2C_NUM_0
#define ACK_CHECK_EN                        0x1              /*!< I2C master will check ack from slave*/
#define ACK_CHECK_DIS                       0x0              /*!< I2C master will not check ack from slave */
#define ACK_VAL                             0x0              /*!< I2C ack value */
#define NACK_VAL                            0x1              /*!< I2C nack value */

#define IIC_SCL_CLEAR()	gpio_set_level(14, 0)
#define IIC_SCL_SET()	gpio_set_level(14, 1)
#define IIC_SDA_CLEAR()	gpio_set_level(2, 0)
#define IIC_SDA_SET()	gpio_set_level(2, 1)
#define IIC_SDA_date(x)	gpio_set_level(2, x)

esp_err_t iic_master_gpio_init(void);
void faster_iic_start(void);
void faster_iic_stop(void);
void faster_iic_wait_ack(void);
void faster_iic_write_byte(unsigned char data);
void faster_iic_write_cmd(unsigned char cmd);

#endif